#include <iostream>
#include <string>
using namespace std;
int main()
{
	string s, t;
	getline(cin, s);
	getline(cin, t);
	bool hash[300] = { 0 };
	for (char ch : t) hash[ch] = true;
	string ret;
	for (auto ch : s)
	{
		if (!hash[ch])
		{
			ret += ch;
		}
	}
	cout << ret << endl;
	return 0;
}